<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>诊断添加</title>
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $('tbody tr:odd').addClass("trLight");

            $(".select-all").click(function(){
                if($(this).attr("checked")){
                    $(".checkBox input[type=checkbox]").each(function(){
                        $(this).attr("checked", true);
                    });
                }else{
                    $(".checkBox input[type=checkbox]").each(function(){
                        $(this).attr("checked", false);
                    });
                }
            });
        });

        $(function(){
            $.ajax({//查询用户id
                url: "<%=basePath%>memList",
                dataType: "json",
                contentType: "application/json;charset=utf-8",
                success: function (data) {
                    for (var i = 0; i < data.length; i++) {
                        $("#memberid").append("<option value='" + data[i].memberid + "' >" + data[i].name + "</option>");
                    }
                },
                error: function (msg) {
                    alert("后台服务器出错，请联系系统管理员");
                }
            });

            $("#memberid").change(function(){//选择用户后查询挂号号
                var memberid = $("#memberid").val();
                $("#roid").empty();
                $.ajax({//查询科室
                    url: "<%=basePath%>roList?memberid="+memberid,
                    dataType: "json",
                    //编码设置
                    contentType: "application/json;charset=utf-8",
                    success: function (data) {
                        $("#roid").append("<option value='0' >-请选择-</option>");
                        for (var i = 0; i < data.length; i++) {
                            $("#roid").append("<option value='" + data[i].roid + "' >" + data[i].roid + "</option>");
                        }
                    },
                    error: function (msg) {
                        alert("后台服务器出错，请联系系统管理员");
                    }
                })

            });
            });


    </script>
    <style type="text/css">
        body {
            background:#FFF
        }
    </style>
</head>

<body>
<form method="post" action="<%=basePath%>zdAddController" method="post" name="ThisForm">
    <div id="contentWrap">
        <!--表格控件 -->
        <div id="widget table-widget">
            <div class="pageTitle">医生诊断添加</div>
            <div class="pageInfo">
                <table>
                    <tr>
                        <td width="20%" align="right">会员</td>
                        <td width="20%"><select id="memberid" name="memberid" >
                            <option value="0">-请选择-</option>
                        </select>
                        </td>
                        <td width="10%" align="right">挂号号</td>
                        <td width="20%"><select id="roid" name="roid" >
                            <option value="0">-请选择-</option>
                        </select>
                    </tr>
                    <tr>
                        <td width="20%" align="right">诊断</td>
                        <td width="80" colspan="3" >
                            <textarea rows="5" cols="12" id="results" name="results" style="width:99%"></textarea></td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center"><input type="submit" value="确定"/> </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</form>
</body>
</html>

